package 博客.工厂模式.抽象工厂;

//抽象工厂
public abstract class AbsFactory {
    public abstract Car getCar();
    public abstract Mark getMark();
}

//奥迪工厂
class AudiFactory extends AbsFactory{
    public Car getCar() {
        return new Audi();
    }
    public Mark getMark() {
        return new AudiMark();
    }
}

//宝马工厂
class BMWFactory extends AbsFactory{
    public Car getCar() {
        return new BMW();
    }
    public Mark getMark() {
        return new BMWMark();
    }
}

//奔驰工厂
class BenzFactory extends AbsFactory{

    public Car getCar() {
        return new Benz();
    }
    public Mark getMark() {
        return new BenzMark();
    }
}
